package com.gs.lookupmethod.beanaware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.Autowired;

import com.gs.lookupmethod.Command;

public class CommandManager implements BeanFactoryAware{
	
	Command command;
	
	private BeanFactory beanFactory;
	
	public Command createCommand(){
		return beanFactory.getBean(Command.class);
	}

	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		this.beanFactory = beanFactory;
	}
}
